# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer: Sergiy Stupar <owner@sestolab.pp.ua>
pkgname=libcyaml
pkgver=1.4.1
pkgrel=2
pkgdesc="C library for reading and writing YAML"
url="https://github.com/tlsa/libcyaml"
arch="all"
license="ISC"
makedepends="yaml-dev"
subpackages="$pkgname-static $pkgname-doc $pkgname-dev"
source="https://github.com/tlsa/libcyaml/archive/v$pkgver/libcyaml-v$pkgver.tar.gz"

build() {
	make VARIANT=release
}

check() {
	make test
}

package() {
	make PREFIX=/usr DESTDIR="$pkgdir" install
	install -Dm644 docs/guide.md -t "$pkgdir"/usr/share/doc/"$pkgname"/
	install -Dm644 examples/numerical/* -t "$pkgdir"/usr/share/doc/"$pkgname"/examples/numerical/
	install -Dm644 examples/planner/* -t "$pkgdir"/usr/share/doc/"$pkgname"/examples/planner/
	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/"$pkgname"/
}

sha512sums="
ecbb8f9e7091027fe288b3a2c8c995cdea83b5c7fe208a87db3a8e1b72b7201c42adfb1b9bc6628d478b66be9d1f7c8dd134358ce43fa6d6cc6c9d20f6452a36  libcyaml-v1.4.1.tar.gz
"
